package org.mortbay.jetty.pico.pages;

import java.util.List;
import org.apache.tapestry5.annotations.PageLoaded;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.mortbay.jetty.pico.dao.category.CategoryDAO;
import org.mortbay.jetty.pico.entities.Category;

/**
 * Start page of application pico.
 */
public class Index {

    @Property
    private Category ownCate;
    
    @Inject
    private CategoryDAO categoryDAO;



    @PageLoaded
    void indexLoaded() {
        List<Category> list = categoryDAO.getParentCategories();
       ownCate =  (list == null || list.size() < 1) ? null : list.get(0);
    }
    
}
